package com.utils;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TripleDTO<L, M, R> {
    private L id;

    private M key;

    private R resp;

    private List<TripleDTO<L, M, R>> child;

    public TripleDTO(L id, M key, R resp) {
        this.id = id;
        this.key = key;
        this.resp = resp;
    }

    public List<TripleDTO<L, M, R>> getChild() {
        if (this.child == null) {
            this.child = new ArrayList<>();
        }
        return child;
    }
}